<?php
	if( !function_exists('pr') ){ 
		include_once('../inc/config.php'); 
		$ruta=array();
	}
	

    $url = explode('.',end($ruta));
    if ( $ruta[1]=='tags' ) {

        include(ROOT.'/blog/blog_busca_tags.php');


    } elseif ( (count($ruta)==1 and $url[1]!='html') or substr($url[0],0,4)=='pag:'  or empty($ruta) ) {

        include(ROOT.'/blog/blog_lista_categoria.php');

    } else {

		if(!isset($url[1])) {
            $tipo = '301 Moved Permanently';    
			$url = URL."/{$ruta[0]}/{$ruta[1]}.html";
			Header("HTTP/1.1 $tipo");
			Header("Location: $url");
        	die();	
			
		}
	
	
        //------- Busco la publicacion
        $Pub = busco_publicacion($url[0]);
        $cat_id = $Pub['categoria_id'];

        $mTitle          = $Pub['Categoria']['titulo1'].' '.$Pub['titulo'];
        $mRobots         = $Pub['robots'];
        $mKeywords       = $Pub['keywords'];
        $mDescription    = $Pub['descripcion'];
        $mImagen         = $Pub['thumbs1'];


        $breadcrumb[0]['href']  = URL;
        $breadcrumb[0]['title'] = $Traducciones['home'];
        $breadcrumb[1]['href']  = URL.'/'.$ruta[0];
        $breadcrumb[1]['title'] = $Pub['Categoria']['titulo1'];
        $breadcrumb[2]['href']  = URL.'/'.$ruta[0].'/'.$ruta[1];
        $breadcrumb[2]['title'] = $Pub['titulo1'];


        include_once(ROOT.'/inc/inc_publicidad.php');
        include_once(ROOT.'/html/header.html.php');
        include_once(ROOT.'/blog/blog_ver.html.php');


    }

    include_once(ROOT.'/html/footer.html.php');
	die();
?>